Optimal. Leaf size=143 \[ \frac{A-i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{A-i B}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x (B+i A)}{16 a^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.192248, antiderivative size = 143, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3590, 3526, 3479, 8} \[ \frac{A-i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{A-i B}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x (B+i A)}{16 a^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3590
Rule 3526
Rule 3479
Rule 8
Rubi steps
\begin{align*} \int \frac{\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^4} \, dx &=-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}-\frac{i \int \frac{a (A+i B)+2 a B \tan (c+d x)}{(a+i a \tan (c+d x))^3} \, dx}{2 a^2}\\ &=-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}-\frac{(i A+B) \int \frac{1}{(a+i a \tan (c+d x))^2} \, dx}{4 a^2}\\ &=-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{A-i B}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{(i A+B) \int \frac{1}{a+i a \tan (c+d x)} \, dx}{8 a^3}\\ &=-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{A-i B}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{A-i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{(i A+B) \int 1 \, dx}{16 a^4}\\ &=-\frac{(i A+B) x}{16 a^4}-\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{A+3 i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{A-i B}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{A-i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}
Mathematica [A] time = 1.22754, size = 141, normalized size = 0.99 \[ \frac{\sec ^4(c+d x) (-3 (8 i A d x+A+B (8 d x+i)) \cos (4 (c+d x))+32 i A \sin (2 (c+d x))+3 i A \sin (4 (c+d x))+24 A d x \sin (4 (c+d x))+16 A \cos (2 (c+d x))-24 i B d x \sin (4 (c+d x))-3 B \sin (4 (c+d x))+12 i B)}{384 a^4 d (\tan (c+d x)-i)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.033, size = 244, normalized size = 1.7 \begin{align*}{\frac{-{\frac{i}{16}}A}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{B}{16\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{A}{8\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{{\frac{i}{8}}B}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{A}{16\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}+{\frac{{\frac{i}{16}}B}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{B}{4\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{{\frac{i}{12}}A}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) -i \right ) A}{32\,{a}^{4}d}}+{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) B}{{a}^{4}d}}+{\frac{A\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{32\,{a}^{4}d}}-{\frac{{\frac{i}{32}}B\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{4}d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.36316, size = 236, normalized size = 1.65 \begin{align*} \frac{{\left ({\left (-24 i \, A - 24 \, B\right )} d x e^{\left (8 i \, d x + 8 i \, c\right )} + 24 \, A e^{\left (6 i \, d x + 6 i \, c\right )} + 12 i \, B e^{\left (4 i \, d x + 4 i \, c\right )} - 8 \, A e^{\left (2 i \, d x + 2 i \, c\right )} - 3 \, A - 3 i \, B\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{384 \, a^{4} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 8.76024, size = 246, normalized size = 1.72 \begin{align*} \begin{cases} \frac{\left (196608 A a^{12} d^{3} e^{18 i c} e^{- 2 i d x} - 65536 A a^{12} d^{3} e^{14 i c} e^{- 6 i d x} + 98304 i B a^{12} d^{3} e^{16 i c} e^{- 4 i d x} + \left (- 24576 A a^{12} d^{3} e^{12 i c} - 24576 i B a^{12} d^{3} e^{12 i c}\right ) e^{- 8 i d x}\right ) e^{- 20 i c}}{3145728 a^{16} d^{4}} & \text{for}\: 3145728 a^{16} d^{4} e^{20 i c} \neq 0 \\x \left (\frac{i A + B}{16 a^{4}} - \frac{\left (i A e^{8 i c} + 2 i A e^{6 i c} - 2 i A e^{2 i c} - i A + B e^{8 i c} - 2 B e^{4 i c} + B\right ) e^{- 8 i c}}{16 a^{4}}\right ) & \text{otherwise} \end{cases} + \frac{x \left (- i A - B\right )}{16 a^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.42321, size = 208, normalized size = 1.45 \begin{align*} -\frac{\frac{12 \,{\left (A - i \, B\right )} \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a^{4}} - \frac{12 \,{\left (A - i \, B\right )} \log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a^{4}} - \frac{25 \, A \tan \left (d x + c\right )^{4} - 25 i \, B \tan \left (d x + c\right )^{4} - 124 i \, A \tan \left (d x + c\right )^{3} - 124 \, B \tan \left (d x + c\right )^{3} - 246 \, A \tan \left (d x + c\right )^{2} + 246 i \, B \tan \left (d x + c\right )^{2} + 252 i \, A \tan \left (d x + c\right ) + 124 \, B \tan \left (d x + c\right ) + 57 \, A - 25 i \, B}{a^{4}{\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{384 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]